import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'

import Login from '@/components/Login'
import BindPhone from '@/components/BindPhone'


Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [{
            path: '/login',
            name: 'Login',
            component: Login,
        }, {
            path: '/bind',
            name: 'BindPhone',
            component: BindPhone,
        },
        {
            path: '/',
            name: 'Index',
            component: Index,
            children: [{
                    path: '/index',
                    component: () =>
                        import ('@/components/Home')
                },
                {
                    path: '/index/goods',
                    component: () =>
                        import ('@/goods/Goods')
                },
                {
                    path: '/index/cate',
                    component: () =>
                        import ('@/goods/Cate')
                },
                // 用户管理
                {
                    path: '/index/role',
                    component: () =>
                        import ('@/user/Role')
                },
                {
                    path: '/index/permission',
                    component: () =>
                        import ('@/user/Permission')
                },
                {
                    path: '/index/users',
                    component: () =>
                        import ('@/user/Users')
                },
                // 修改密码
                {
                    path: '/index/change_password',
                    component: () =>
                        import ('@/user/ChangePassword')
                },
                // 广告分类管理
                {
                    path: '/index/adv_cate',
                    component: () =>
                        import ('@/advertising/AdvCate')
                },
                // 广告列表
                {
                    path: '/index/adv_list',
                    component: () =>
                        import ('@/advertising/AdvList')
                },
                {
                    path: '/index/order',
                    component: () =>
                        import ('@/order/Order')
                },
                // 销售报表
                {
                    path: '/index/goods_report',
                    component: () =>
                        import ('@/report/GoodsReport')
                },
                {
                    path: '/index/brand_report',
                    component: () =>
                        import ('@/report/BrandReport')
                },
                {
                    path: '/index/cate_report',
                    component: () =>
                        import ('@/report/CateReport')
                },
            ]
        }
    ]
})